package com.neusoft.weekreport.component.bizService.impl;

import com.neusoft.weekreport.component.bizService.TaskBizService;
import com.neusoft.weekreport.component.entities.DcTask;
import com.neusoft.weekreport.component.entities.DcTaskExample;
import com.neusoft.weekreport.component.req.GetTaskInfoListReq;
import com.neusoft.weekreport.component.resp.GetTaskInfoListResp;
import com.neusoft.weekreport.mapper.DcTaskMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class TaskBizServiceImpl  implements TaskBizService {

    @Resource
    DcTaskMapper dcTaskMapper;

    //查询有效项目
    @Override
    public GetTaskInfoListResp getValidTaskInfoList(GetTaskInfoListReq req) throws Exception {
        GetTaskInfoListResp resp = new GetTaskInfoListResp();
        DcTaskExample dcTaskExample = new DcTaskExample();
        DcTaskExample.Criteria criteria = dcTaskExample.createCriteria();
        criteria.andEnableEqualTo(1);
        dcTaskExample.setOrderByClause("order_Num");
        List<DcTask> dcTaskList = dcTaskMapper.selectByOtherExample(dcTaskExample);
        resp.setDcTaskList(dcTaskList);
        return resp;
    }

}

